if(!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.userMgt.window.Window")) {
    jsx3.require("com.gix.gui.Block")

    /**
     * window
     */
    jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.userMgt.window", function (eap) {
    });

    /**
     * window
     */
    jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.userMgt.window.Window",
            com.gix.gui.Block,
            null,
            function (mgtwindow) {

                mgtwindow.wwidth = 1200;
                mgtwindow.wheight = 785;
                mgtwindow.wresizable = true;
                mgtwindow.wscrollable = true;
                mgtwindow.wtitle = "Manage users"

                /**
                 * instance initializer
                 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
                 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
                 */
                mgtwindow.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
                    //call constructor for super class (the super expects the name of the object and the function that it is an instance of)
                    this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
                };

                mgtwindow.prototype.subscribeAll = function() {
                    var me = this;
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_SELECTED, me, me.loadDetails);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_REMOVED, me, me.reSetPanes);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_MULTISELECT, me, me.reSetPanes);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.userMgt.EventID.ADD_ITEM_CANCELED, me, me.setPanes);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.userMgt.EventID.ADD_ITEM_REQUIRED, me, me.loadAdd);
                }

                mgtwindow.prototype.unsubscribeAll = function() {
                    var me = this;
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_SELECTED, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_REMOVED, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.userMgt.EventID.MASTER_ROW_MULTISELECT, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.userMgt.EventID.ADD_ITEM_CANCELED, me);
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.userMgt.EventID.ADD_ITEM_REQUIRED, me);
                }

                mgtwindow.prototype.loadSubComponent = function(nodeName, path, target, fctn) {
                    var domeNode = this.getDescendantOfName(nodeName)
                    if(domeNode.getChildren().length == 0) {
                        /*
                        if (nodeName == "paneDetail_24_A") {
                            this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                        }
                        */
                        tibco.admin.Main.loadUIResourceAsync(domeNode, "tibco.admin", path, target, fctn, true)
                    }
                }

                mgtwindow.prototype.componentLoaded = function(objEvent) {
                    if(objEvent.status == "SUCCESS") {
                        this.childList = objEvent.obj;
                        var me = this;
                        this.childList.handler = me;
                    }
                }

                /**
                 * Creates a new jsx3.gui.Window instance for this server.
                 * A branch of the DOM of this application can be placed in this window in order to distribute the application across multiple browser windows.
                 *
                 * @return {jsx3.gui.Window}
                 */
                mgtwindow.prototype.openNewWindow = function() {
                    var windowname = this.getWindowName() + "_" + this._counter
                    var window;
                    var newwindow
                    try {
                        /*
                        window = tibco.admin.Main.getServer().getAppWindow(windowname);
                        if (window) {
                            if (window.isOpen()) {
                                window.focus();
                                this._counter++;
                                return;
                            }
                            window.getParent().removeChild(window);
                        }
                        */
                        window = tibco.admin.Main.getServer().createAppWindow(windowname);
                        window.setWidth(mgtwindow.wwidth);
                        window.setHeight(mgtwindow.wheight)
                        window.setResizable(mgtwindow.wresizable)
                        window.setScrollable(this.wscrollable)
                        window.setTitle(mgtwindow.wtitle + " instance " + windowname)
                        window.subscribe(jsx3.gui.Window.WILL_CLOSE, this, this.willClose)
                        window.open();

                        var myclone = this.doClone()
                        myclone.setWindowName(windowname)
                        window.adoptChild(myclone, true)
                        this._counter++;
                    }
                    catch(e) {
                        jsx3.util.Logger.GLOBAL.error("Can't create a new widow", jsx3.NativeError.wrap(e));
                    }
                    return window;
                }

                /**
                 *@param strName {String} ?the unique name of the window to create
                 */
                mgtwindow.prototype.setWindowName = function(strName) {
                    this.windowName = strName
                }

                /**
                 *@param strName {String} ?the unique name of the window to create
                 **/
                mgtwindow.prototype.getWindowName = function() {
                    return this.windowName
                }

                mgtwindow.prototype.loadDetails = function(objEvent) {
                    try {
                        if(objEvent.windowId == this.getId() && !objEvent.isRetained) {
                            this.loadSubComponent("paneDetail_24_A", objEvent.strPath);
                            this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            this.getDescendantOfName("paneAdd_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                        }

                    }
                    catch(e) {
                        tibco.admin.util.Log.USERMGT.error("tibco.admin.enterpriseAssets.userMgt.window.Window#loadDetails: " + e)
                    }
                }

                mgtwindow.prototype.loadAdd = function(objEvent) {
                    try {
                        if(objEvent.windowId == this.getId() && !objEvent.isRetained) {
                            this.loadSubComponent("paneAdd_24_A", objEvent.strPath);
                            this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            this.getDescendantOfName("paneAdd_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                            this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                        }

                    }
                    catch(e) {
                        tibco.admin.util.Log.USERMGT.error("tibco.admin.enterpriseAssets.userMgt.window.Window#loadAdd: " + e)
                    }
                }

                mgtwindow.prototype.setPanes = function(objEvent) {
                    tibco.admin.util.Log.USERMGT.trace("mgtwindow.prototype.setPanes objEvent.windowId = " + objEvent.windowId + "   this.getId() =" + this.getId())
                    try {
                        if(objEvent.windowId == this.getId() && !objEvent.isRetained) {
                            var masters = this.getDescendantsOfType(objEvent.master)
                            if(masters[0]) {
                                if(masters[0].getSelectedRecord()) {
                                    this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                                    this.getDescendantOfName("paneAdd_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                                    this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                                    return;
                                }
                            }
                            this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                            this.getDescendantOfName("paneAdd_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                        }

                    }
                    catch(e) {
                        tibco.admin.util.Log.USERMGT.error("tibco.admin.enterpriseAssets.userMgt.window.Window#setPanes: " + e)
                        tibco.admin.util.Log.USERMGT.error(e.description)

                    }
                }

                mgtwindow.prototype.reSetPanes = function(objEvent) {
                    tibco.admin.util.Log.USERMGT.trace("mgtwindow.prototype.setPanes objEvent.windowId = " + objEvent.windowId + "   this.getId() =" + this.getId())
                    try {
                        if(objEvent.windowId == this.getId() && !objEvent.isRetained) {
                            var masters = this.getDescendantsOfType(objEvent.master)
                            if(masters[0]) {
                                this.getDescendantOfName("paneDetailWelcome_24_A").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                                this.getDescendantOfName("paneAdd_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                                this.getDescendantOfName("paneDetail_24_A").setDisplay(jsx3.gui.Block.DISPLAYNONE, true)
                            }
                        }

                    }
                    catch(e) {
                        tibco.admin.util.Log.USERMGT.error("tibco.admin.enterpriseAssets.userMgt.window.Window#setPanes: " + e)
                        tibco.admin.util.Log.USERMGT.error(e.description)

                    }
                }

                mgtwindow.prototype.willClose = function(objEvent) {
                    objEvent.target.getParent().removeChild(objEvent.target);
                }

                mgtwindow.prototype.doRefresh = function() {
                    this.childList.doRefresh();
                }
            });
}